package com.cat.dynamicPlanning;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/count-number-of-ways-to-place-houses/description/
 * @create 2025/8/27 16:22
 * @since JDK17
 */

public class Solution13 {
    static int N = ((int) (1e9 + 7));
    public int countHousePlacements(int n) {
        long[] dp = new long[n + 1];
        dp[0] = 1l;
        dp[1] = 2l;
        for (int i = 2; i <= n; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % N;
        }
        return ((int) ((dp[n] * dp[n]) % N));
    }
}
